function f_clear_table()
{   #drop table, truncate table, drop partition, truncate partition
    declare _select_host_sql _is_has_node _drop_md5 _rollback_md5 _dbadb_rule _opt_error fun_name
    declare _insert_node_sql _get_node_id_sql _get_node_id _insert_dbadb _exe_time _opt_state _master_host
    declare _opt _opt_time table_name table_name_list _create_table _tmp_line _rename_name _new_table _get_rollback_sql
    declare -a _rollback_sql _drop_sql_list
    f_get_diy_info || true
    fun_name="f_clear_table"
    _opt_error=1
    mysql_port="$(sed 's/[^0-9]//g' <<< "${mysql_port}")"
    #检查必要的参数是否有
    for _opt in "-P:${mysql_port}" "-D:${mysql_db}" "-T:${clear_table_list}" "-u:${user_mail_addr}" "-O:${user_order_id}"
    do
        [ "${mode_opt}x" == "crontab_dropx" ] && break
        if [ -z "$(awk -F: '{print $2}' <<< "${_opt}")" ]
        then
            f_logging "$(eval echo ${log_addr}):WARN" "'$(awk -F: '{print $1}' <<< "${_opt}")' 是必须选项"
            _opt_error=0
        fi
    done

    [ -z "${user_mail_addr}" ] && f_logging "$(eval echo ${log_addr}):WARN" "-u xxx@qq.com 是必须选项"

    _opt="${1}"
    _opt_time="${2}"

    _select_host_sql="select count(*) from ${t_mdl_node} where host = '${mysql_host}' and port='${mysql_port}' and role = 'master';"
    _is_has_node="$(timeout ${exe_time} ${mysql_comm_dbadb} -NBe "${_select_host_sql}" 2>/dev/null)" && exe_state="${?}" || exe_state="${?}"
    if [ "${_is_has_node}x" == "0x" ] && [ ${exe_state} -eq 0 ]
    then #不存在节点信息就insert一条记录
       _insert_node_sql="insert into ${t_mdl_node}(id,host,port,role) select 0,'${mysql_host}','${mysql_port}','master'"
    elif [ ${exe_state} -ne 0 ]
    then
        _is_has_node="$(timeout ${exe_time} ${mysql_comm_dbadb} -NBe "${_select_host_sql}" 2>&1)" || true
        f_logging "$(eval echo ${log_addr}):ERROR" "访问 ${dbadb_db} 库异常 : ${_is_has_node} ] [ ${_select_host_sql}" "2" "1"
    elif [ "${_is_has_node}x" == "0x" ]
    then
        f_logging "$(eval echo ${log_addr}):ERROR" "未知异常" "2" "1"
    fi

    _get_node_id_sql="${_insert_node_sql};select id from ${t_mdl_node} where host = '${mysql_host}' and port = '${mysql_port}'"
    _get_node_id_sql="${_get_node_id_sql} and role = 'master' limit 1;"
    _get_node_id="$(timeout ${exe_time} ${mysql_comm_dbadb} -NBe "${_get_node_id_sql}" 2>/dev/null)" && exe_state="${?}" || exe_state="${?}"

    if [ "${_opt}x" == "recoverx" ]
    then #如果是recover操作就返回rollback语句
        _get_rollback_sql="select rollback_sql_list from ${t_order_drop} where user_mail = '${user_mail_addr}' and oid = '${user_order_id}';" 
        __="$(timeout ${exe_time} ${mysql_comm_dbadb} -NBe "${_get_rollback_sql}" 2>&1)" && exe_state="${?}" || exe_state="${?}"
        if [ ${exe_state} -ne 0 ]
        then
            f_logging "$(eval echo ${log_addr}):ERROR" "在 ${dbadb_port} 库查找回滚sql异常 : ${__} ] [ ${_get_rollback_sql}" "2" "1"
        elif [ -z "${__}" ]
        then
            f_logging "$(eval echo ${log_addr}):WARN" "在 ${dbadb_port} 库没有查找到符合条件的回滚语句 ] [ ${_get_rollback_sql}" "2" "1"
        else
            f_logging "$(eval echo ${log_addr}):REMAIND" "查到符合条件的回滚语句 ] [ ${__}"
            f_logging "$(eval echo ${log_addr}):WARN" "如需回滚删除操作, 请在 '${mysql_host}:${mysql_port}'上执行该语句, 执行前请确认好是否要执行 ]" "2"
            f_exit "0"
        fi
        f_exit "1"
    elif [ "${_opt}x" == "crontab_dropx" ]
    then #如果是crontab操作就读${t_mdl_node}表的记录, 看都有哪些是延迟操作
        _exe_time="$(date +%F)"
        _sql_file_="${script_execute_drop_dir}/${_exe_time}.sql"
        _log_file_="${script_execute_drop_dir}/${_exe_time}.log"
        __="update ${t_order_drop} set inip = '${localhost_ip}' where opt_state = 1 and exe_time <= '${_exe_time}' and inip = '';
            select concat(t1.id,'@@@',t2.port,'@@@',t1.db_name,'@@@',t1.drop_md5,'@@@',t1.drop_sql_list,'@@@',t2.host) from ${t_order_drop} t1 
                join ${t_mdl_node} t2 on t1.nid = t2.id where t1.opt_state = 1 and t1.exe_time <= '${_exe_time}' and inip = '${localhost_ip}';"

        timeout ${exe_time} ${mysql_comm_dbadb} -NBe "${__}" > ${_sql_file_} 2>/dev/null && exe_state="${?}" || exe_state="${?}"

        if [ ${exe_state} -ne 0 ]
        then
            _get_drop_sql="${__}"
            __="$(cat ${_sql_file_})"

            f_logging "$(eval echo ${log_addr}):ERROR" "在 ${dbadb_port} 库查找删除sql异常 : ${__} ] [ ${_get_drop_sql}" "2" "1"
        elif [ "$(wc -l < ${_sql_file_})x" == "0x" ]
        then
            _get_drop_sql="${__}"
            f_logging "$(eval echo ${log_addr}):WARN" "在 ${dbadb_port} 库查找删除sql为空 ] [ ${_get_drop_sql}" "2" "1"
        fi
        declare _id_ _port_ _db_ _md5_ _sql_ _master_ _mysql_comm_ line
        while read line
        do #处理读出来的信息
            _id_="$(awk -F'@@@' '{print $1}' <<< "${line}")"
            _port_="$(awk -F'@@@' '{print $2}' <<< "${line}")"
            _db_="$(awk -F'@@@' '{print $3}' <<< "${line}")"
            _md5_="$(awk -F'@@@' '{print $4}' <<< "${line}")"
            _sql_="$(awk -F'@@@' '{print $5}' <<< "${line}")"
            _master_host="$(awk -F'@@@' '{print $6}' <<< "${line}")"

            if [ "$(md5sum <<< "${_sql_}"|awk '{print $1}')x" != "${_md5_}x" ]
            then #验证drop sql的md5值, 预防人为误操作修改了drop操作
                timeout ${exe_time} ${mysql_comm_dbadb} -NBe "update ${t_order_drop} set opt_state = 2 where id = ${_id_}" 2>/dev/null || true
                f_logging "$(eval echo ${log_addr}):WARN" "${_port_}端口的延迟删除记录 id:${_id_} 对应的删除sql的md5值发生了变化, 因此不做删除操作" "2" "0" "0"
                continue
            fi

            #__="select rshost from ${t_mysql_rs} where iState = '0' and rsRole = 'master' and rsPort = ${_port_}"
            #_master_="$(timeout ${exe_time} ${mysql_comm_dbadb} -NBe "${__}" 2>&1|sed '/Using a password/d')" || true
            _mysql_comm_="mysql --default-character-set=utf8 -u${mysql_user} -p${mysql_pass} -h${_master_host} -P${_port_} ${_db_}"
            __="$(${_mysql_comm_} -e "${_sql_}" 2>&1)" && exe_state="${?}" || exe_state="${?}"
            if [ ${exe_state} -ne 0 ]
            then
                f_logging "$(eval echo ${log_addr}):WARN" "${_port_}端口的 '${_db_}' 延迟删除记录操作失败 ] [ ${_sql_} ] [ '${__}'" "2" "0" "0"
                __="update ${t_order_drop} set opt_state = 2 where id = ${_id_} and inip = '${localhost_ip}'"
            else
                f_logging "$(eval echo ${log_addr}):INFO" "${_port_}端口的 '${_db_}' 延迟删除记录操作完成 ] [ ${_sql_}" "2" "0" "0"
                __="update ${t_order_drop} set opt_state = 0 where id = ${_id_} and inip = '${localhost_ip}'"
            fi
            timeout ${exe_time} ${mysql_comm_dbadb} -NBe "${__}" 2>/dev/null || true
        done < ${_sql_file_}|tee -a ${_log_file_}
        { cat ${_log_file_}|grep "延迟删除记录操作失败" > ${html_dir}/${user_mail_addr}.tmp;} || true
        if [ -s "${html_dir}/${user_mail_addr}.tmp" ]
        then #存在执行失败的情况, 就发邮件给dba
            echo "<html>
    <head>
        <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
        <title>延迟删表/清表任务异常</title>
    </head>
    <body>
        <p>采集时间: $(date "+%F %H:%M:%S") </p>
        <table  border='1' cellspacing='0'>
            <caption>任务异常记录展示</caption>
            <tr>
                <th width=500>操作端口</th> 
                <th width=500>操作sql</th>
                <th width=500>失败原因</th> 
            </tr>
            $(
                grep -v " 成功 " ${html_dir}/${user_mail_addr}.tmp |awk 'BEGIN { 
                        FS="[" ; 
                        RS="]" ;
                        row=1 ;
                    } 
                    NF>1 { 

                        if(NR % 8 == 0) {
                            print "<th>"$NF"</th></tr>";
                            row=0 ;
                        } else if(row == 6) { 
                            printf "<tr><th>"$NF"</th>" ;
                        } else if(row == 8 || row == 7) {
                            printf "<th>"$NF"</th>" ;
                        } 
                        row+=1;
                    }'
             )
        </table>
    </body>
</html>" > ${html_dir}/${user_mail_addr}
            exe_state=0
            ${send_mail_script} -s "【巡检】!重要!-延迟删表/清表任务异常" -t html -u "${user_mail_addr}" -f "${html_dir}/${user_mail_addr}" || exe_state="${?}"
            [ ${exe_state} -eq 0 ] && rm -f "${html_dir}/${user_mail_addr}"
        fi
        f_exit "0"
    fi

    table_name_list=($(tr "," " " <<< "${clear_table_list}")) #需要删表的列表
    one_sql_is_error=1                                        #删表操作是否全部成功, 有一个失败就设为0
    declare _exe_tools _del_dbadb_rule_var
    #存在规则且有清理规则 
    declare -A _error_table_list_for_par
    #存在规则, 没有清理规则, 但是是当前使用的表
    declare -A _error_table_list_for_cur
    _t_list=""
    for table_name in ${table_name_list[@]}
    do
        _t_list="${_t_list} ${table_name}"
        _rename_name="$(date "+%m%d%H%M%S")"
        _new_table="_${table_name}_${_rename_name}_new_table"
        _rename_name="_${table_name}_${_rename_name}_delete"
        if [ "${#_new_table}" -gt 63 ]
        then
            _new_table="_$(md5sum <<< "${table_name}_${_rename_name}"|awk '{print $1}')_new_table"
            _rename_name="_$(md5sum <<< "${table_name}_${_rename_name}"|awk '{print $1}')_delete"
        fi
        _opt_state=0

        _exe_time="$(date +%F)"

        if [ "${_opt}x" == "rename tablex" ]
        then #如果是延迟删除就先rename
            line="$(awk -v T="${table_name}" -v t="\`${_rename_name}\`" '{print "rename table "T" to "t";"}' <<< "${line}")"
            f_check_mysql_for_key_word "${table_name}" "表名" "table" "${line}"            #检查表名是否是保留字
            _rollback_sql+=("rename table \`${_rename_name}\` to ${table_name};") #记录rename操作,
            _drop_sql_list+=("drop table if exists \`${_rename_name}\`;")                   
            #记录drop操作, 这个sql是给crontab读出来并执行的, 这样做的好处就是不用让crontab去扫描所有的端口然后去查找有没有需要删除的表
            if [ "${_opt_time}x" == "laterx" ]
            then
                [ $(date +%H) -gt 16 ] && _exe_time="$(date +%F -d "4 day")" || _exe_time="$(date +%F -d "3 day")" #16点前提交的就延迟3天, 16点后提交的就延迟4天
            else
                _exe_time="$(date +%F -d "1 day")" #统一在第二天凌晨5点删除
            fi
            _opt_state=1
            _exe_tools="rename"
        elif [ "${_opt}x" == "drop tablex" ]
        then #这个暂时废弃了
            line="drop table ${table_name};"
            f_check_mysql_for_key_word "${table_name}" "表名" "table" "${line}"
            _exe_tools="drop"
        elif [ "${_opt}x" == "truncate tablex" ]
        then #truncate table统一使用rename操作, 避免truncate时间过长影响业务
            _tmp_line="${line}"
            line="create table \`${_new_table}\` like ${table_name};alter table \`${_new_table}\` auto_increment = 1"
            f_check_mysql_for_key_word "${table_name}" "表名" "table" "${line}"
            _create_table="${line}"
            line="${_tmp_line}"
            table_name="$(sed 's/`//g' <<< "${table_name}")"
            line="$(awk -v T="\`${table_name}\`" -v t="\`${_rename_name}\`" '{print "rename table "T" to "t}' <<< "${line}")"
            f_check_mysql_for_key_word "${table_name}" "表名" "table" "${line}" >/dev/null 2>&1
            _rollback_sql+=("rename table ${table_name} to \`_$(sed 's/`//g' <<< "${table_name}"|md5sum|awk '{print $1}')_rollback_before\`, \`${_rename_name}\` to ${table_name};")
            _drop_sql_list+=("drop table if exists \`${_rename_name}\`;")
            _tmp_line="${line}"
            table_name="$(sed 's/`//g' <<< "${table_name}")"
            line="${_new_table} to ${table_name};"
            f_check_mysql_for_key_word "${table_name}" "表名" "table" "${line}" >/dev/null 2>&1
            line="\`${_new_table}\` to ${table_name};"
            line="${_create_table};${_tmp_line},${line}"
            _exe_tools="rename"
            _opt_state=1
            if [ "${_opt_time}x" == "laterx" ]
            then
                if [ $(date +%H) -gt 16 ]
                then
                   _exe_time="$(date +%F -d "4 day")"
                else
                   _exe_time="$(date +%F -d "3 day")" #16点前提交的就延迟3天, 16点后提交的就延迟4天
                fi
            else #没有later关键属性就添加一个drop table的操作
                #line="$(sed 's/;$//g' <<< "${line}");drop table if exists \`${_rename_name}\`;"
                line="$(sed 's/;$//g' <<< "${line}");"
                _exe_time="$(date +%F -d "1 day")" #统一在凌晨5点删除
            fi
        else
            one_sql_is_error=0
            break
        fi

        f_check_table_size "$(sed 's/`//g' <<< "${table_name}")" >&2 || { 
            f_logging "$(eval echo ${log_addr}):ERROR" "${return__}" >&2
            unset return__
            one_sql_is_error=0
        }

        f_create_test_env "${table_name}" >&2 && exe_state="${?}" || exe_state="${?}" #再测试环境create业务表
        [ ${exe_state} -eq 1 ] && one_sql_is_error=0  && continue                     #创建失败就continue
        echo "${line}"                                                                #打印出drop|truncate|rename sql到文件
    done > ${alter_file_tmp1}


    if [ "${one_sql_is_error}x" == "0x" ]
    then
        for _phy_par_name in ${!_error_table_list_for_par[@]}
        do
            __="${mysql_port}端口的 '[${mysql_db}.${_phy_par_name}] [${_error_table_list_for_par[${_phy_par_name}]%,}]' 表在dbadb存在物理分表管理规则"
            __="${__}, 且存在清理规则, [${_error_table_list_for_par[${_phy_par_name}]%,}]操作不允许, 请联系dba进行处理"
            f_logging "$(eval echo ${log_addr}):ERROR" "${__}" >&2
        done

        for _phy_par_name in ${!_error_table_list_for_cur[@]}
        do
            __="${mysql_port}端口的 '[${mysql_db}.${_phy_par_name}] [${_error_table_list_for_cur[${_phy_par_name}]%,}]' 表在dbadb存在物理分表管理规则"
            __="${__}, 不存在清理规则, 但是本次清理的表为当前还使用的表, [${_error_table_list_for_cur[${_phy_par_name}]%,}]操作不允许, 请联系dba进行处理"
            f_logging "$(eval echo ${log_addr}):ERROR" "${__}" >&2
        done
        f_logging "$(eval echo ${log_addr}):ERROR" "检查不通过请根据提示进行修改!!!" "2" "1"
    elif [ "$(cat ${alter_file_tmp1}|grep -iPc "[a-z]")x" == "0x" ]
    then
        f_logging "$(eval echo ${log_addr}):ERROR" "根据表名生成sql'${alter_file_tmp1}' 文件为空, 说明所有表都不可操作, 请根据提示进行修改!!!" "2" "1"
    fi

    f_logging "$(eval echo ${log_addr}):REMAIND" "开始在测试环境 '${test_host}:${test_port}' 执行如下${_opt}操作"
    [ "${execute}" == "0x" ] && cat ${alter_file_tmp1}
    cat ${alter_file_tmp1}|${test_mysql_comm} ${test_db} -NBf >/dev/null 2> ${sql_exe_error} || true
    if [ "$(grep -ic "error" ${sql_exe_error})x" != "0x" ]
    then
        [ -f "${sql_exe_error}" ] && __="$(sed '/Using a password on /d' ${sql_exe_error})"
        f_record_info_to_dbadb "drop" "test" "测试遇到未知失败. 详情请看${localhost_ip}:${log_file}" || true
        f_logging "$(eval echo ${log_addr}):ERROR" "提交的'${_opt}'语句存在如上所示的语法错误, 请检查后重新提交 ] [ ${__}" "2" "1"
    else
        f_logging "$(eval echo ${log_addr}):INFO" "提交的sql文件通过检测, 在测试环境执行成功"
    fi
    
    #测试环境执行成功后, 就将信息落库到dbadb_db, t_order_drop_col是表结构
    t_order_drop_col="id,nid,oid,user_mail,opt_type,db_name,table_list,exe_sql_list,drop_sql_list,drop_md5,rollback_sql_list,rollback_md5,cur_time,exe_time,opt_state"
    _drop_md5="$(md5sum <<< "${_drop_sql_list[@]}"|awk '{print $1}')"
    _rollback_md5="$(md5sum <<< "${_rollback_sql[@]}"|awk '{print $1}')"
    _insert_dbadb="insert into ${t_order_drop}(${t_order_drop_col}) select 0,${_get_node_id},${user_order_id},'${user_mail_addr}','${mode_opt}','${mysql_db}'"
    _insert_dbadb="${_insert_dbadb},'${clear_table_list}','$(tr "\n" " " < "${alter_file_tmp1}")','${_drop_sql_list[@]}','${_drop_md5}'"
    _insert_dbadb="${_insert_dbadb},'${_rollback_sql[@]}','${_rollback_md5}','$(date +%F)','${_exe_time}',${_opt_state};"
    _delete_dbadb="delete from ${t_order_drop} where oid = ${user_order_id} and user_mail = '${user_mail_addr}';"

    if [ "${execute}x" != "1x" ]
    then
        if [ "${execute_opt}x" != "1x" ]
        then
            f_logging "$(eval echo ${log_addr}):REMAIND" "测试环境执行通过, 如需在生产环境执行, 请在原来参数的基础上加 '-e 1' " "2"
            echo "[ $(date "+%F %H:%M:%S") ] [ 提示 ] [ ${localhost_ip} ] [ 测试环境执行通过, 如需在生产环境执行, 请在原来参数的基础上加 '-e 1' ]"
        else
            f_logging "$(eval echo ${log_addr}):REMAIND" "测试环境执行通过, 下面准备在生产环境执行"
        fi
        return 0
    fi

    { echo "${_insert_dbadb}"|sed 's/`/\\`/g'|timeout ${exe_time} ${mysql_comm_dbadb} 2> ${sql_exe_error};} && exe_state="${?}" || exe_state="${?}"
    if [ ${exe_state} -eq 0 ]
    then
        f_logging "$(eval echo ${log_addr}):INFO" "'${_opt}' 入库(${dbadb_port})成功 ] [ $(echo "${_insert_dbadb}")"
    else
        __="$(sed '/Using a password on /d' ${sql_exe_error})" || true
        f_logging "$(eval echo ${log_addr}):ERROR" "'${_opt}' 入库(${dbadb_port})失败 ] [ ${__} ] [ $(echo "${_insert_dbadb}")" "2" "1"
    fi

    f_logging "$(eval echo ${log_addr}):REMAIND" "现在开始在 '${mysql_host}:${mysql_port}' 环境执行提交的${_opt}语句"
    one_sql_is_error=1
    declare _check_t
     
    while read line
    do
        #根据不同的操作获取表名
        if [ "${_exe_tools}x" == "renamex" ]
        then
            _check_t="$(awk -F 'rename table' '{print $2}' <<< "${line}"|awk '{print $1}')"
        elif [ "${_exe_tools}x" == "dropx" ]
        then
            _check_t="$(awk -F 'drop table' '{print $2}' <<< "${line}"|awk '{print $1}')"
        elif [ "${_exe_tools}x" == "truncatex" ]
        then
            _check_t="$(awk -F 'truncate table' '{print $2}' <<< "${line}"|awk '{print $1}')"
        fi

        _check_t="$(sed 's/`//g' <<< "${_check_t}"|sed 's/;$//g')" #将表名的反引号去掉

        osc_run_mark_file="${script_execute_mark_dir}/mark.${mysql_host}.${mysql_port}.${mysql_db}.${_check_t}_${_PPID}"
        osc_run_mark_file_list+=("${osc_run_mark_file}")
        #检查mdl状态任务标志文件,存在就是任务还没完成
        check_mdl_mark_file="${script_execute_mark_dir}/f_check_mdl_lock_for_${mysql_host}_${mysql_port}_${mysql_db}_${_check_t}_${_PPID}" 
        #检查连接数任务的标志文件,存在就是任务还没完成
        check_connect_file="${script_execute_mark_dir}/f_check_process_for_${mysql_host}_${mysql_port}_${mysql_db}_${_check_t}_${_PPID}"   
        check_thread_file="${script_execute_mark_dir}/f_check_thread_for_${mysql_host}_${mysql_port}_${mysql_db}_${_check_t}_${_PPID}"   
        max_thread_file="${script_execute_mark_dir}/max_thread_for_${mysql_host}_${mysql_port}_${mysql_db}_${_check_t}_${_PPID}"   

        pause_file_name="${script_execute_mark_dir}/${_exe_tools}.panic.${mysql_host}.${mysql_port}.${mysql_db}.${_check_t}.flag.${_PPID}"
        f_check_work_is_run "${_exe_tools}" "${_check_t}"
        {
            touch ${check_mdl_mark_file} && first_check_mdl_mark=3 && sleep 0.2 && wait_mdl_time=$((${check_mdl_timeout}-5))
            f_check_mdl_lock "${mysql_host}" "master" "${mysql_db}" "${_check_t}" "${_PPID}" "null" "${_exe_tools}" || true
            { [ -f "${check_mdl_mark_file}" ] && rm -f ${check_mdl_mark_file};} || true
            [ -f "${check_connect_file}" ] && rm -f ${check_connect_file}
            [ -f "${check_thread_file}" ] && rm -f ${check_thread_file}
        } >> ${log_file} &

        { f_check_daemonize "drop" "${_check_t}" || true;} &

        timeout 60s ${mysql_comm} -e "use ${mysql_db} ; ${line}" 2> ${sql_exe_error} && exe_state="${?}" || exe_state="${?}"
        if [ ${exe_state} -eq 0 ]
        then
            [ -f "${pause_file_name}" ] && chattr -i ${pause_file_name} && rm -f "${pause_file_name}"
            f_logging "$(eval echo ${log_addr}):INFO" "提交的${line}语句, 已经在 '${mysql_host}:${mysql_port}' 环境执行成功"
        elif [ ${exe_state} -eq 124 ]
        then
            f_logging "$(eval echo ${log_addr}):ERROR" "提交的${line}语句, 在 '${mysql_host}:${mysql_port}' 环境执行60超时, 现在开始检查是否遇到mdl等待" "2"
        else
            f_logging "$(eval echo ${log_addr}):ERROR" "提交的${line}语句, 在 '${mysql_host}:${mysql_port}' 环境执行失败" "2"
            one_sql_is_error=0
            break
        fi
    done < ${alter_file_tmp1}

    if [ "${one_sql_is_error}x" == "1x" ]
    then
        f_logging "$(eval echo ${log_addr}):INFO" "提交的${_opt}语句, 已经在 '${mysql_host}:${mysql_port}' 环境执行成功"
    else
        f_logging "$(eval echo ${log_addr}):ERROR" "提交的${_opt}语句, 已经在 '${mysql_host}:${mysql_port}' 环境执行失败, 或者部分失败" "2"
        { echo "${_delete_dbadb}"|sed 's/`/\\`/g'|timeout ${exe_time} ${mysql_comm_dbadb} 2>/dev/null;} && exe_state="${?}" || exe_state="${?}"
        if [ ${exe_state} -eq 0 ]
        then
            f_logging "$(eval echo ${log_addr}):INFO" "因线上执行失败, '${_opt}' 删除入库记录(${dbadb_port}) 成功 ] [ $(echo "${_insert_dbadb}")"
        else
            f_logging "$(eval echo ${log_addr}):ERROR" "因线上执行失败, '${_opt}' 删除入库记录(${dbadb_port}) 失败 ] [ $(echo "${_insert_dbadb}")" "2"
        fi
        [ -f "${sql_exe_error}" ] && __="$(sed '/Using a password on /d' ${sql_exe_error})"
        f_record_info_to_dbadb "drop" "${_check_t}" "遇到未知失败. 详情请看${localhost_ip}:${log_file}" || true
        f_logging "$(eval echo ${log_addr}):ERROR" "提交的${_opt}语句, 在 '${mysql_host}:${mysql_port}' 环境执行失败 ] [ ${__}" "2" "1"
    fi
    return 0
}

